#pragma once
#include <memory>
#include <string>
#include <list>
#include <mutex>

class FpObserver;

class _declspec(dllexport) FpSubject
{
public:
	FpSubject();
	virtual ~FpSubject() = default;

	virtual void Attach(std::weak_ptr<FpObserver>,std::string str="");
	virtual void Detach(std::weak_ptr<FpObserver>, std::string str = "");
	virtual void Notify(int status);
	virtual void Notify(std::string status);
	virtual void DetachAll();

private:
	std::list<std::weak_ptr<FpObserver>> _observerList;
	std::list<std::string>				 _observerStrList;
	std::mutex							 _mtxObserver;
};

